//
//  MainController.m
//  jang
//
//  Created by lee han on 16/04/2017.
//  Copyright © 2017 lee han. All rights reserved.
//

#import "MainController.h"
#import "CommonView.h"

MainController* mInstance;

@interface MainController ()

@end

@implementation MainController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    mInstance = self;
    self.delegate = self;
    self.tabBar.tintColor = [CommonView NavigationColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)selectCategoryView {
    [self setSelectedIndex:1];
}

- (void)selectShopcarView {
    [self setSelectedIndex:3];
}

#pragma mark UITabBarControllerDelegate
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
    if([viewController isKindOfClass:[UINavigationController class]]){
        [(UINavigationController*)viewController popToRootViewControllerAnimated:NO];
    }
}
//end UITabBarControllerDelegate

+(MainController*)sharedInstance{
    return mInstance;
}
@end
